package service.Impl;


import dao.AdminsDao;
import dao.Impl.AdminsDaoImpl;
import entity.Admins;
import service.AdminsService;

import java.util.List;

public class AdminsServiceImpl implements AdminsService {
    private AdminsDao adminsDao = new AdminsDaoImpl();
    @Override
    public List<Admins> findAll() {
        return adminsDao.findAll();
    }

    @Override
    public Admins findById(int id) {
        return adminsDao.findById(id);
    }

    @Override
    public void save(Admins admin) {
        adminsDao.save(admin);
    }

    @Override
    public void update(Admins admin) {
        adminsDao.update(admin);
    }

    @Override
    public void delete(int id) {
        adminsDao.delete(id);
    }

    @Override
    public List<Admins> findByName(String name) {
        return adminsDao.findByName(name);
    }

    @Override
    public Admins login(String name, String password) {
        return adminsDao.login(name,password);
    }
}
